package com.mq.server.config;

import com.mq.server.constant.MyConstants;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * <h3>partitionjob</h3>
 * <p>receiver 接收 消费者</p>
 *  RabbitListener : 标识监听哪个队列
 *  RabbitHandler : 标识监听到的队列的处理器
 * @author : hduong
 * @version : 1.0
 * @date : 2019-12-19 10:34
 **/
@Component
@RabbitListener(queues = MyConstants.HELLO_QUEUE )
public class Receiver {

    @RabbitHandler
    public void process(String msg) {
        System.out.println("Receiver: " + msg);
    }
}
